Add an option for device model to disable key repeat.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 13 Dec 2005 16:01:09 +0000 (17:01 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 13 Dec 2005 16:01:09 +0000 (17:01 +0100)
On slow network, when creating a vmx guest remotely,
the key repeat feature may make it hard to even type
the user name and password to login in to guest OS.

Signed-off-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
tools/ioemu/sdl.c
tools/ioemu/vl.c
tools/ioemu/vl.h

index 9e262bf4de11e750870886e5d8528372d6ac388e..1c8154a406cb900ebadc2f40af9714e59f530da1 100644 (file)
@@ -592,7 +592,8 @@ void sdl_display_init(DisplayState *ds, int full_screen)
 
     sdl_resize(ds, 640, 400);
     sdl_update_caption();
-    SDL_EnableKeyRepeat(250, 50);
+    if(repeat_key)
+        SDL_EnableKeyRepeat(250, 50);
     SDL_EnableUNICODE(1);
     gui_grab = 0;
 
index d0fa5c5d561b26ec3e9ac0cda6d00b45f4e2078c..19b433330570351230a70fd41263131d06377238 100644 (file)
@@ -145,6 +145,7 @@ int graphic_width = 800;
 int graphic_height = 600;
 int graphic_depth = 15;
 int full_screen = 0;
+int repeat_key = 1;
 TextConsole *vga_console;
 CharDriverState *serial_hds[MAX_SERIAL_PORTS];
 int xc_handle;
@@ -2250,6 +2251,7 @@ void help(void)
            "-std-vga        simulate a standard VGA card with VESA Bochs Extensions\n"
            "                (default is CL-GD5446 PCI VGA)\n"
            "-vgaacc [0|1]   1 to accelerate CL-GD5446 speed, default is 1\n"
+           "-no-repeatkey   disable key repeat feature for SDL keyboard simulation"
 #endif
            "-loadvm file    start right away with a saved state (loadvm in monitor)\n"
            "\n"
@@ -2342,6 +2344,7 @@ enum {
     QEMU_OPTION_loadvm,
     QEMU_OPTION_full_screen,
     QEMU_OPTION_vgaacc,
+    QEMU_OPTION_repeatkey,
 };
 
 typedef struct QEMUOption {
@@ -2421,6 +2424,7 @@ const QEMUOption qemu_options[] = {
     { "nic-ne2000", 0, QEMU_OPTION_nic_ne2000 },
     { "cirrusvga", 0, QEMU_OPTION_cirrusvga },
     { "vgaacc", HAS_ARG, QEMU_OPTION_vgaacc },
+    { "no-repeatkey", 0, QEMU_OPTION_repeatkey },
     { NULL },
 };
 
@@ -2976,6 +2980,9 @@ int main(int argc, char **argv)
                     }
                 }
                 break;
+            case QEMU_OPTION_repeatkey:
+                repeat_key = 0;
+                break;
             case QEMU_OPTION_std_vga:
                 cirrus_vga_enabled = 0;
                 break;
index d38a9e1a713b462066ee332065307e9ed18f133b..b05c22f96469944625cc0c5528cd09d75dc0be98 100644 (file)
@@ -612,6 +612,7 @@ void pci_pcnet_init(PCIBus *bus, NetDriverState *nd);
 
 void kbd_init(void);
 extern const char* keyboard_layout;
+extern int repeat_key;
 
 /* mc146818rtc.c */